1. Field of the Invention
The present invention is related to a method, an apparatus and a program for coding a moving picture by adopting one of coding modes.
2. Description of the Related Art
A moving picture coding method, which adopts a prediction coding system having a plurality of prediction modes and a plurality of block shapes, has been discussed in a joint committee of ITU-T and ISO/IEC as “ITU-T Rec. H. 264” and “ISO/IEC 14496-10” (hereinafter referred to as “H. 264”).
In an in-frame prediction coding system of H. 264, either of a 4×4 prediction block and a 16×16 prediction block may be selected as a block shape for each prediction block. As used herein, in-frame refers to intra-frame. Moreover, one prediction mode may be selected from a plurality of prediction modes so as to execute a predicting operation. In the in-frame predicting systems of MPEG-1, MPEG-2, and MPEG-4, which correspond to the conventional coding system, prediction modes which may be selected are not so many. In H. 264, however, prediction blocks are as small as 16×16 pixel blocks and/or 4×4 pixel blocks, an optimum prediction mode may be selected from the great variety of prediction modes in correspondence with a feature of an image. In an inter-frame prediction coding system, predicting operations larger than, or equal to an 8×8 pixel block size has been conventionally employed. In H. 264, because predicting operations in a 4×4 pixel block size may be carried out, a predicting operation having precision higher than the conventional prediction method may be realized by motion compensation derived from plural sheets of reference images which have already been coded. As previously explained, a total number of these prediction modes is increased which may be selected for each block; and such a coding mode having a higher prediction efficiency is selected in order that the coding efficiency is improved.
Also, a rate-distortion-wise optimizing method has been proposed, in which while a generated code amount is employed as a constraint condition, a coding control operation is carried out by employing the Lagrange undetermined multiplying method.
This rate-distortion-wise optimizing method corresponds to such a method that a coding mode having the highest coding efficiency is selected based upon a generated code amount which is obtained by being actually coded and a coding error (for example, square error between original image and local decode image, mean square error thereof, and the like).
However, this rate-distortion-wise optimizing method owns the following problem. That is, when a total number of these coding modes and a total number of these block shapes are increased, the coding operations must be repeatedly carried out plural times which are equal to a total number of possible mode combinations, so that actual calculation time is increased.
It is important to properly select a coding mode for each pixel block; thus, various techniques for selecting the modes have been proposed:
(1) A method adopting a coding mode having a small prediction error. Please see JP-A-2003-153280 (Japanese Laid-open Patent Application NO. 2003-153280).
(2) A method by which a to-be-generated code amount is estimated based upon a prediction residual signal, or the like; and then, a coding mode is selected in such a manner that the to-be-generated code amount as estimated becomes minimum. Please see JP-A-10(1998)-290464 (Japanese Laid-open Patent Application NO. Hei-10-290464).
(3) A method by which coding operations are actually carried out as to respective coding modes, and then, such a coding mode is selected, the code amount of which is minimum. Please see JP-A-2003-153280and JP-A-9(1997)-322176 (Japanese Laid-open Patent Application NO. 2003-153280 and NO. Hei-9-322176).
(4) A method by which in addition to the above-described selecting method (3), a coding distortion is calculated for each coding mode; namely, an error between a decoded image and an original image is calculated with respect to each of these coding modes; and then, an optimum coding mode is selected by considering a balance between a generated code amount and a coding distortion. Please see Thomas Wiegand and Berand Girod “Multi-frame motion compensated prediction for video transmission”, Kluwer Academic Publishers, 2001.
In the selecting methods (1) and (2), since the coding modes are selected based upon estimation and prediction, there are some possibilities that the selections of the coding modes are not properly made; and thus, the coding operations may not be carried out in a high coding efficiency.
In contrast, in the selecting methods (3) and (4), the selections of the coding modes are carried out based upon the code-amount measuring results obtained by the actual coding operations; thus, generally speaking, the coding operations is carried out in the higher coding efficiency. However, in the selecting methods (3) and (4), the coding operation must be actually carried out so as to actually measure the generated code amount with respect to each of the selectable coding modes. As a result, although the coding efficiencies is improved, in when not a few coding modes are employed, there is such a problem that; a calculation amount and a hardware scale are increased which are required for coding operations; and cost of encoders increases.
In view of the above, it is aimed to provide a moving picture coding method and a moving picture coding apparatus, capable of selecting a suitable coding mode when any one coding mode is selected from a plurality of coding modes so as to code a moving picture, while suppressing an increase in processing loads and the like.